package org.zsl.mapper;

import org.junit.Test;
import  org.zsl.model.Product;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class ProductMapperTestor {

    @Autowired
    private ProductMapper productMapper;

    @Test
    public void testSelect()
    {

        Product  product=  productMapper.selectById(1);
        System.out.println(product);
        System.out.println(product.getProductType());
    }



    @Test
    public void testSelectByExample(){

        Product product = new Product();
        product.setModel("bn001");

        List<Product> list = productMapper.selectByExample(product);

        System.out.println(list);
    }


    @Test
    public void  testSelectIds(){
         int[] ids = new int[]{
                 2,3,4
         };

        List<Product> list = productMapper.selectInIds(ids);

        System.out.println(list);
    }
}
